What is indexOf method in JavaScript